package com.yuanchu.store.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yuanchu.store.dto.EditAddressDto;
import com.yuanchu.store.entity.YoshopUserAddressEntity;

import java.util.List;

/**
 * 用户收货地址表
 *
 * @author adan
 * @email 2028038953@gmail.com
 * @date 2023-12-19 20:57:20
 */
public interface YoshopUserAddressService extends IService<YoshopUserAddressEntity> {


    /**
     * 查询用户收货地址
     * @param userId
     * @return
     */
    List<YoshopUserAddressEntity> queryUserAddress(Integer userId, Integer storeId);

    /**
     * 查询用户默认收货地址
     * @param userId
     * @return
     */
    Integer queryUserDefaultAddressId(Integer userId);

    /**
     * 查询用户收货地址详情
     * @param userId
     * @param addressId
     * @return
     */
    YoshopUserAddressEntity queryUserDetailAddress(Integer userId, Integer addressId);

    /**
     * 修改用户收货地址
     *
     * @param userId
     * @param addressForm
     * @return
     */
    boolean editUserAddress(Integer userId, EditAddressDto addressForm);

    /**
     * 新增用户收货地址
     * @param userId
     * @param form
     */
    void addUserAddress(Integer userId, EditAddressDto form);

    /**
     * 设置用户默认收货地址
     * @param userId
     * @param addressId
     * @return
     */
    boolean setUserDefaultAddress(Integer userId, Integer addressId, Integer storeId);

    /**
     * 删除用户收货地址
     * @param userId
     * @param addressForm
     * @return
     */
    boolean removeUserAddress(Integer userId, EditAddressDto addressForm, Integer storeId);
}

